package org.inspursc.s0517.health.evaluation.converter;

import org.inspursc.s0517.health.evaluation.dto.CategoryDTO;
import org.inspursc.s0517.health.evaluation.dto.QuestionCategoryDTO;
import org.inspursc.s0517.health.evaluation.entity.QuestionCategory;
import org.springframework.beans.BeanUtils;

/**
 * @author B_Dream
 * @date 2018/5/22 16:51
 */
public class QuestionCategoryConverter {

    public static QuestionCategory converter(QuestionCategoryDTO categoryDTO) {
        QuestionCategory category = new QuestionCategory();
        BeanUtils.copyProperties(categoryDTO, category);
        return category;
    }


    public static QuestionCategory converterNoQu(CategoryDTO categoryDTO) {
        QuestionCategory category = new QuestionCategory();
        BeanUtils.copyProperties(categoryDTO, category);
        return category;
    }

    public static CategoryDTO converterNoQu(QuestionCategory category) {
        CategoryDTO categoryDTO = new CategoryDTO();
        BeanUtils.copyProperties(category, categoryDTO);
        return categoryDTO;
    }


    public static QuestionCategoryDTO converter(QuestionCategory category) {
        QuestionCategoryDTO categoryDTO = new QuestionCategoryDTO();
        BeanUtils.copyProperties(category, categoryDTO);
        return categoryDTO;
    }


}
